package com.ylb.rent.entity.vo;

import com.ylb.rent.entity.School;
import com.ylb.rent.entity.SchoolApartmentDist;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @AUTHOR:游李滨
 * @DATE:2023/7/3 10:03
 */
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ApartmentSchoolVo {

        private static final long serialVersionUID = 1L;

        /** $column.columnComment */
        private Long id;

        private long schoolId;

        /** 学校 */
        private String schoolName;


        /** 步行 */

        private Long onfoot;

        /** 公交 */

        private Long bybus;

        /** 出租 */

        private Long bytexi;


        public ApartmentSchoolVo(School school, SchoolApartmentDist schoolApartmentDist){
                this.id=school.getId();
                this.schoolId=school.getId();
                this.schoolName=school.getSchoolName();
                this.onfoot=schoolApartmentDist.getOnfoot();
                this.bybus=schoolApartmentDist.getBybus();
                this.bytexi=schoolApartmentDist.getBytexi();
        }

        /**
         *      公寓id没有，其他都有
         *
         * */
        public SchoolApartmentDist getApartmentSchool(){
                return SchoolApartmentDist.builder()
                        .schoolId(this.schoolId)
                        .onfoot(this.onfoot)
                        .bybus(this.bybus)
                        .bytexi(this.bytexi).build();
        }

}
